// 提供商品相关api

import request from '@/utils/request'
// 获取商品详情
export const getProduct = (id) => {
  return request('/goods', 'get', { id })
}
// 获取相关推荐/猜你喜欢
/**
 *
 * @param {string} id - 传入表示同类推荐，不传猜你喜欢
 * @param {integer} limit -
 *
 */
export const getRelevantGood = ({ id, limit = 16 }) => {
  return request('/goods/relevant', 'get', { id, limit })
}
// 获取热榜
export const getGoodsHot = ({ id, limit = 3, type = 1 }) => {
  return request('/goods/hot', 'get', { id, limit, type })
}
// 获取热榜
export const getGoodsComment = (id) => {
  // return request(`/goods/${id}/evaluate`, 'get')
  // 当使用http打头的地址，不会再拼接baseurl
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
}
// 评论
export const getCommentList = (id, params) => {
  // return request(`/goods/${id}/evaluate`, 'get')
  // 当使用http打头的地址，不会再拼接baseurl
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}
